﻿using System.Web;
using Drill.LocatorPattern;
using Drill.TestSupport.Mocks.MockDrillBits;

namespace Drill.Integration.Web.Mocks
{
	public class SimpleDomainAndHttpContextBaseMockDrillBit : SimpleDomainMockDrillBit
	{
		private readonly HttpContextLocator _httpContextLocator;

		public SimpleDomainAndHttpContextBaseMockDrillBit()
		{
			_httpContextLocator = new HttpContextLocator(new HttpContextMock());

			GetInstanceHandlerMap.Add(typeof(ILocator<HttpContextBase>), HandleGetInstanceILocatorOfHttpContextBase);
		}

		private object HandleGetInstanceILocatorOfHttpContextBase(string name)
		{
			return _httpContextLocator;
		}
	}
}